﻿@{
    Bundle("markItUpBBCode");
    Bundle("jquery_validate");
}
           
<script type="text/javascript">
    jQuery(document).ready(function () {
        jQuery('@ID("#form")').validate({
            rules: {
                text: {
                    required: true
                }
            }
        });
        jQuery('@ID("#txt_text")').markItUp(markItUpBBCodeSet);
    });
</script>
<form class="common-form" id="@ID("form")" action="@Url.Action(Loc.Act("Create").Localized())" method="post">
    <input type="hidden" name="topicID" value="@JDM.Int32(Model.Topic.EntityID)" />
    <input type="hidden" name="parentID" value="@(Model.Parent != null ? JDM.Int32(Model.Parent.EntityID) : 0)" />
    <table>
        <tr>
            <td>
                <label>@T(Res.Name("Text"))</label>
            </td>
            <td>
            @if(Model.Parent != null)
            {
                <textarea id="@ID("txt_text")" name="text" maxlength="4000">@BBCodeHelper.Quote(JDM.String(Model.Parent.Member.Account.Username), JDM.String(Model.Parent.Text))</textarea>
            }
            else
            {
                <textarea id="@ID("txt_text")" name="text" maxlength="4000"></textarea>
            }
            </td>
        </tr>
    </table>
    <ul class="bar toolbar">
        <li><button class="button" type="submit">@T(Res.In("Common").Of("Act").Name("Submit"))</button></li>
    </ul>
</form>
